<link rel="stylesheet" href="../admin/app/lib/colorpicker/bootstrap-colorpicker.css">
<section class="content-header">
	<h1>
		{{title}}<small></small>
	</h1>
</section>
<section class="content">
	<div class="box box-default">
		<div class="col-md-12">
			<div class="box-body" ng-controller="productsku as at">
				<alertdanger></alertdanger>
				<alertsuccess></alertsuccess>
				<form role="form">
					<div class="box-body">
						<div class="form-group">
							<label> <input type="radio" ng-model="type"
								ng-value="1" class="flat-red" ng-checked="true"> SKU文字
							</label> <label> <input type="radio" ng-model="type"
								ng-value="2" class="flat-red"> SKU颜色
							</label>
						</div>
						<div class="form-group">
							<label>名称</label> <input maxlength="20" required="required"
								ng-model="name" value="" class="form-control" type="text"
								placeholder="请输入名称">
						</div>
						<div class="form-group">
							<label>标签</label> <input ng-model="tag"
								class="form-control" type="text" value="" placeholder="请输入标签">
						</div>
						<div class="form-group">
							<label>说明</label> <input ng-model="note"
								class="form-control" type="text" value="" placeholder="请输入说明">
						</div>
						<div class="form-group">
							<label>排序</label> <input maxlength="3" required="required"
								ng-model="sort" ng-value="1" class="form-control" type="number"
								placeholder="请输入数字">
						</div>
						<div class="form-group">
							<label> <input type="radio" ng-model="isshare"
								ng-value="1" class="flat-red" ng-checked="true"> 共享
							</label> <label> <input type="radio" ng-model="isshare"
								ng-value="0" class="flat-red"> 不共享
							</label>

						</div>
						<div class="form-group">
							<label> <input type="radio" ng-model="status"
								ng-value="1" class="flat-red" ng-checked="true"> 启用
							</label> <label> <input type="radio" ng-model="status"
								ng-value="0" class="flat-red"> 禁用
							</label>

						</div>
						<div class="form-group">
							<button class="btn btn-block btn-default"
								ng-click="addsku();">添加SKU</button>
						</div>
						<div class="col-md-3" ng-repeat="at in skus">
							<div class="alert alert-info alert-dismissable">
								<button ng-click="remove($index)" type="button" class="close"
									data-dismiss="alert" aria-hidden="true">&times;</button>
								<h4>
									<i class="icon fa fa-info"></i>
								</h4>
								<div ng-show="textskushow" class="form-group">
									<label>文字SKU值</label> <input maxlength="20"
										ng-model="at.skuval" class="form-control" type="text">
								</div>
								<div ng-show="colorskushow" class="form-group">
                  <label>颜色SKU值</label>
                 
                     <input type="text" ng-model="at.skuval" class="form-control my-colorpicker1">
                	<div style="height:20px;weight:20px;background-color:{{at.skuval}}">
                       
                      </div>
									<script>
										$(".my-colorpicker1").colorpicker();
									</script>
                </div>

							</div>
						</div>
					</div>
					<div class="box-footer">
						<button ng-show="savebtn.show" type="button"
							class="btn btn-primary" ng-click="save();">保存</button>
						<button ng-show="updatebtn.show" type="button"
							class="btn btn-primary" ng-click="update();">更新</button>
					</div>
				</form>
			</div>
		</div>
		<div class="box-footer"></div>
	</div>
</section>
